package com.bjsdzk.common.configurer;

import com.mongodb.MongoClientOptions;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created by zealdin on 2017/8/28.
 */
@Configuration
public class MongoConfiguration {

    static class OptionsConfig {

        @Bean
        public MongoClientOptions mongoOptions() {
            return MongoClientOptions.builder()
                    .socketTimeout(100000)
                    .connectTimeout(6000000)
                    .maxConnectionIdleTime(6000000)
                    .maxConnectionLifeTime(0)
                    .socketKeepAlive(true)
                    .build();
        }

    }
}
